#include<graphics.h>
#include<conio.h>
#include<stdio.h>
int main()
{
	float Pi = 3.14159;
	initgraph(800,600);
	setbkcolor(RGB(204,204,204));
	cleardevice();

	int centerX = 400;//圆心坐标
	int centerY = 300;
	float radius = 148;
	int left = centerX-radius;//圆外切矩形左上角x坐标
	int right = centerX+radius;//圆外切矩形右下角x坐标
	int top = centerY-radius;//圆外切矩形左上角y坐标
	int bottom = centerY+radius;//圆外切矩形右下角y坐标
	int i;
	float offset;
	float totaloffset = 0;
	
	for(radius=300;radius>249;radius=radius-10)
	{
		int left = centerX-radius;//圆外切矩形左上角x坐标
	    int right = centerX+radius;//圆外切矩形右下角x坐标
	    int top = centerY-radius;//圆外切矩形左上角y坐标
	    int bottom = centerY+radius;//圆外切矩形右下角y坐标

	for(i=0;i<8;i++)
	{
		offset = i*Pi/4+totaloffset ;
	    setfillcolor(RGB(153,0,51));
	    solidpie(left,top,right,bottom,0+offset,Pi/16+offset);
	    setfillcolor(RGB(0,0,0));
	    solidpie(left,top,right,bottom,Pi/16+offset,2*Pi/16+offset);
	    setfillcolor(RGB(220,220,0));
	    solidpie(left,top,right,bottom,2*Pi/16+offset,3*Pi/16+offset);
	    setfillcolor(RGB(255,255,255));
	    solidpie(left,top,right,bottom,3*Pi/16+offset,4*Pi/16+offset);
	}
	    totaloffset = totaloffset+Pi/16;
		setfillcolor(RGB(204,204,204));
	    solidcircle(centerX,centerY,radius-10);
	}


	for(radius=220;radius>177;radius=radius-7)
	{
		int left = centerX-radius;//圆外切矩形左上角x坐标
	    int right = centerX+radius;//圆外切矩形右下角x坐标
	    int top = centerY-radius;//圆外切矩形左上角y坐标
	    int bottom = centerY+radius;//圆外切矩形右下角y坐标

	for(i=0;i<8;i++)
	{
		offset = i*Pi/4+totaloffset ;
	    setfillcolor(RGB(153,0,51));
	    solidpie(left,top,right,bottom,0+offset,Pi/16+offset);
	    setfillcolor(RGB(0,0,0));
	    solidpie(left,top,right,bottom,Pi/16+offset,2*Pi/16+offset);
	    setfillcolor(RGB(220,220,0));
	    solidpie(left,top,right,bottom,2*Pi/16+offset,3*Pi/16+offset);
	    setfillcolor(RGB(255,255,255));
	    solidpie(left,top,right,bottom,3*Pi/16+offset,4*Pi/16+offset);
	}
	    totaloffset = totaloffset+Pi/16;
		setfillcolor(RGB(204,204,204));
	    solidcircle(centerX,centerY,radius-10);
	}
		

	for(radius=147;radius>126;radius=radius-4)
	{
		int left = centerX-radius;//圆外切矩形左上角x坐标
	    int right = centerX+radius;//圆外切矩形右下角x坐标
	    int top = centerY-radius;//圆外切矩形左上角y坐标
	    int bottom = centerY+radius;//圆外切矩形右下角y坐标

	for(i=0;i<8;i++)
	{
		offset = i*Pi/4+totaloffset ;
	    setfillcolor(RGB(153,0,51));
	    solidpie(left,top,right,bottom,0+offset,Pi/16+offset);
	    setfillcolor(RGB(0,0,0));
	    solidpie(left,top,right,bottom,Pi/16+offset,2*Pi/16+offset);
	   setfillcolor(RGB(220,220,0));
	    solidpie(left,top,right,bottom,2*Pi/16+offset,3*Pi/16+offset);
	    setfillcolor(RGB(255,255,255));
	    solidpie(left,top,right,bottom,3*Pi/16+offset,4*Pi/16+offset);
	}
	    totaloffset = totaloffset+Pi/16;
		setfillcolor(RGB(204,204,204));
	    solidcircle(centerX,centerY,radius-5);
	}


	for(radius=96;radius>67;radius=radius-4)
	{
		int left = centerX-radius;//圆外切矩形左上角x坐标
	    int right = centerX+radius;//圆外切矩形右下角x坐标
	    int top = centerY-radius;//圆外切矩形左上角y坐标
	    int bottom = centerY+radius;//圆外切矩形右下角y坐标

	for(i=0;i<8;i++)
	{
		offset = i*Pi/4+totaloffset ;
	    setfillcolor(RGB(153,0,51));
	    solidpie(left,top,right,bottom,0+offset,Pi/16+offset);
	    setfillcolor(RGB(0,0,0));
	    solidpie(left,top,right,bottom,Pi/16+offset,2*Pi/16+offset);
	   setfillcolor(RGB(220,220,0));
	    solidpie(left,top,right,bottom,2*Pi/16+offset,3*Pi/16+offset);
	    setfillcolor(RGB(255,255,255));
	    solidpie(left,top,right,bottom,3*Pi/16+offset,4*Pi/16+offset);
	}
	    totaloffset = totaloffset+Pi/16;
		setfillcolor(RGB(204,204,204));
	    solidcircle(centerX,centerY,radius-5);
	}

	    setfillcolor(RGB(204,204,204));
	    solidpie(left,top,right,bottom,-Pi/3,-Pi/6);

	    for(radius=147;radius>0;radius=radius-20)
	{
		int left = centerX-radius;//圆外切矩形左上角x坐标
	    int right = centerX+radius;//圆外切矩形右下角x坐标
	    int top = centerY-radius;//圆外切矩形左上角y坐标
	    int bottom = centerY+radius;//圆外切矩形右下角y坐标
		
	    setfillcolor(RGB(153,0,51));
	    solidpie(left,top,right,bottom,-7*Pi/24,-5*Pi/24);
	    setfillcolor(RGB(0,0,0));
	    solidpie(left+5,top+5,right-5,bottom-5,-7*Pi/24,-5*Pi/24);
	    setfillcolor(RGB(220,220,0));
	    solidpie(left+10,top+10,right-10,bottom-10,-7*Pi/24,-5*Pi/24);
	    setfillcolor(RGB(255,255,255));
	    solidpie(left+15,top+15,right-15,bottom-15,-7*Pi/24,-5*Pi/24);
	}
		setfillcolor(RGB(204,204,204));
	    solidpie(left+21,top+21,right-21,bottom-21,-Pi/3,-Pi/6);
	
		for(radius=110;radius>0;radius=radius-20)
	{
		int left = centerX-radius;//圆外切矩形左上角x坐标
	    int right = centerX+radius;//圆外切矩形右下角x坐标
	    int top = centerY-radius;//圆外切矩形左上角y坐标
	    int bottom = centerY+radius;//圆外切矩形右下角y坐标
		
	    setfillcolor(RGB(153,0,51));
	    solidpie(left,top,right,bottom,-7*Pi/24,-5*Pi/24);
	    setfillcolor(RGB(0,0,0));
	    solidpie(left+5,top+5,right-5,bottom-5,-7*Pi/24,-5*Pi/24);
	    setfillcolor(RGB(220,220,0));
	    solidpie(left+10,top+10,right-10,bottom-10,-7*Pi/24,-5*Pi/24);
	    setfillcolor(RGB(255,255,255));
	    solidpie(left+15,top+15,right-15,bottom-15,-7*Pi/24,-5*Pi/24);
	}

	_getch();
	return 0;
}